import request from '@/utils/request.js'
import common from '@/common/common'

// 正式提交
export function personCollege (data) {
  return request({
    url: common.CC_API + '/monitor/api/personCollege',
    method: 'post',
    data
  })
}

// 获取简历信息
export function getPersonInfo () {
  return request({
    url: common.CC_API + '/person/api/v2/person',
    method: 'GET'
  })
}

// 新增简历附加信息
export function resumeInfo (data) {
  return request({
    url: common.CC_API + '/person/api/v2/person/additionalNew',
    method: 'POST',
    data
  })
}

// 获取字典
export function getDictionary (type) {
  return request({
    url: common.CC_API + '/person/api/v2/dictionary?type=' + type,
    method: 'GET'
  })
}

export function uploadPic (file) {
  const data = new FormData()
  data.set('file', file)
  return request({
    url: common.CC_API + '/person/api/v2/person/upload',
    method: 'post',
    data
  })
}

export function findByCode (id) {
  return request({
    url: common.CC_API + `/person/api/v2/rasicRegion/findByCode/${id}`,
    method: 'get'
  })
}

export function updatePersonInfo (data) {
  return request({
    url: common.CC_API + '/person/api/v2/person/saveOrUpdatePerson',
    method: 'post',
    data
  })
}

// 根据当前用户生成PDF
export function resumePdf (params) {
  return request({
    url: common.CC_API + '/person/api/v2/person/downloadPDF',
    method: 'GET',
    params: params
    // responseType: 'blob'
  })
}

// 获取重要信息
export function importtanInfo (params) {
  return request({
    url: common.CC_API + '/user/api/v2/users/info/authority',
    method: 'GET'
    // params: params
    // responseType: 'blob'
  })
}
